package com.inspur.gs.sbssdl.sbwhgl.sbrh.sbrh.back.commoncmps;
import com.inspur.edp.dxc.common.domain.CommonResult;
import com.inspur.edp.dxc.spi.components.BaseAfterDBUpdateComponent;
import com.inspur.edp.qdp.bql.api.IBqlExecuter;
import com.inspur.edp.qdp.bql.api.OptionType;
import io.iec.edp.caf.runtime.config.BqlBeanUtil;

import java.util.ArrayList;

public class SbssSbrhBzDatabaseAfter extends BaseAfterDBUpdateComponent {

    private final IBqlExecuter bqlExecuter = BqlBeanUtil.getAppCtx().getBean(IBqlExecuter.class);
    public void DataBaseImportAfter() {
        String sql = "delete from SBSS_SBRH_STAND where DEVCLASS IS NULL or DEVSPEC IS NULL or LUFATNAME is null or LUITEM is null ";

        bqlExecuter.getOptions().setOptionType(OptionType.ExecuteSql);

        int i = bqlExecuter.executeBqlStatement(sql, new ArrayList<>());

        CommonResult result = super.getResult();
        result.setSuccess(true);
    }
}